package com.ymttest.database.sqlwapper.godmch;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.mch_info;
import com.ymttest.database.model.serviceProvider;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.MapUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/************************************************************************************
 * @Author : 吴文
 * @Date : 
 * @Copyright : 洋码头
 *godmach
 ************************************************************************************/
public class serviceProviderWapper {
	SqlManager manage;
	public serviceProviderWapper() {
		manage = new SqlManager("mysqlgodmchdb" + EnvSetup.getEnv());
		 
	}
	public  serviceProvider selectByPrimaryKey(Integer providerId) throws InterruptedException {
		serviceProvider model=new serviceProvider();
		List<serviceProvider> list =  manage.getSelectResults("com.ymttest.database.mapping.godmch.serviceProviderMapper.selectByPrimaryKey",providerId);
		if(list.size()>0)
			model=list.get(0);
		manage.commit();
		return model;
	}
	
	public  Integer selectTotal(HashMap map) throws InterruptedException {
		Integer total =0;
		List<Map> list =  manage.getSelectResults("com.ymttest.database.mapping.godmch.serviceProviderMapper.selectTotal",map);
		if(list.size()>0)
			total=Integer.parseInt(list.get(0).get("total").toString());
		manage.commit();
		return total;
	}
	
	
	public  List<Map> selectProviders(HashMap map) throws InterruptedException {
		
		List<Map> list =  manage.getSelectResults("com.ymttest.database.mapping.godmch.serviceProviderMapper.selectProviders",map);

		manage.commit();
		return list;
	}
	
	
	public static void min(String args[]) throws InterruptedException {
	
	}
}
